﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Skyhook.Sprites
{
    internal static class SpriteLayers
    {
        public const int Unknown = -1;
        public const int Helpers = 0;
        public const int Minimum = 1;
        public const int Landscape = 2;
        public const int Shadow = 3;
        public const int Huge = 4;
        public const int Animation = 5;
        public const int Unit_1 = 6;
        public const int Unit_2 = 7;
        public const int AnimationTop = 8;
        public const int Maximum = 9;

        private static SortedDictionary<string,int> Layers = null;

        static SpriteLayers()
        {
            Layers = new SortedDictionary<string, int>();

            Layers["unknown"] = Unknown;
            Layers["helpers"] = Helpers;
            Layers["minimum"] = Minimum;
            Layers["landscape"] = Landscape;
            Layers["shadow"] = Shadow;
            Layers["unit_1"] = Unit_1;
            Layers["huge"] = Huge;
            Layers["animation"] = Animation;
            Layers["animation_top"] = AnimationTop;
            Layers["unit_2"] = Unit_2;
            Layers["maximum"] = Maximum;
        }

        static public int ConvertLayerStringToInt(string layername)
        {
            int result = Unknown;
            if (Layers.TryGetValue(layername, out result))
            {
                return result;
            }
            throw new Exception("Unknown layer type " + layername);
        }
    }
}
